/**   
 * 项目名：五位一体化工安全信息平台
 * 日期：    2019-12-07 14:44:45  
 * Copyright (c) 2015- joysuch-版权所有     
 */

package com.joysuch.wwyt.bp.entity;

import com.joysuch.wwyt.core.support.AutoSetCommonFieldListener;
import org.apache.commons.lang3.builder.EqualsBuilder;
import org.apache.commons.lang3.builder.HashCodeBuilder;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import org.hibernate.annotations.SQLDelete;
import org.hibernate.annotations.SQLDeleteAll;
import org.hibernate.annotations.Where;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import javax.persistence.*;

import static javax.persistence.GenerationType.IDENTITY;

@EntityListeners({ AuditingEntityListener.class, AutoSetCommonFieldListener.class })
@Entity
@Table(name = "WWYT_BP_MAIN_PRODUCT")
@SQLDelete(sql="update WWYT_BP_MAIN_PRODUCT set DELETE_FLAG = '1' where id= ?")
@SQLDeleteAll(sql="update WWYT_BP_MAIN_PRODUCT set DELETE_FLAG = '1' where id= ?")
@Where(clause="DELETE_FLAG = '0'")

public class BpMainProduct implements java.io.Serializable{
    
    //columns START
    //ID
    private Long id;
    //编号
    private String code;
    //名称
    private String name;
    //年产量
    private String output;
    //产量单位
    private String outputUnit;
    //主要生产工艺
    private String manufaturingTech;
    //备注
    private String remark;
    //附件ID
    private Long attachmentId;
    //创建人
    private Long createBy;
    //创建时间
    private java.util.Date createTime;
    //更新人
    private Long updateBy;
    //更新时间
    private java.util.Date updateTime;
    //删除标记
    private String deleteFlag;
    //组织机构代码
    private String orgCode;
    //租户
    private Long tenentId;
    //columns END


    public void setId(Long value) {
        this.id = value;
    }
    
    @Id
    @GeneratedValue(strategy = IDENTITY)
    @Column(name = "Id", unique = true, nullable = false)
    public Long getId() {
        return this.id;
    }
    
     
    @Column(name = "CODE", length = 10)
    public String getCode() {
        return this.code;
    }
    
    public void setCode(String value) {
        this.code = value;
    }
    
     
    @Column(name = "NAME", length = 50)
    public String getName() {
        return this.name;
    }
    
    public void setName(String value) {
        this.name = value;
    }
    
     
    @Column(name = "OUTPUT")
    public String getOutput() {
        return this.output;
    }
    
    public void setOutput(String value) {
        this.output = value;
    }
    
     
    @Column(name = "OUTPUT_UNIT", length = 10)
    public String getOutputUnit() {
        return this.outputUnit;
    }
    
    public void setOutputUnit(String value) {
        this.outputUnit = value;
    }
    
     
    @Column(name = "MANUFATURING_TECH", length = 500)
    public String getManufaturingTech() {
        return this.manufaturingTech;
    }
    
    public void setManufaturingTech(String value) {
        this.manufaturingTech = value;
    }
    
     
    @Column(name = "REMARK", length = 500)
    public String getRemark() {
        return this.remark;
    }
    
    public void setRemark(String value) {
        this.remark = value;
    }
    
     
    @Column(name = "ATTACHMENT_ID")
    public Long getAttachmentId() {
        return this.attachmentId;
    }
    
    public void setAttachmentId(Long value) {
        this.attachmentId = value;
    }
    
     
    @org.springframework.data.annotation.CreatedBy
    @Column(name = "CREATE_BY")
    public Long getCreateBy() {
        return this.createBy;
    }
    
    public void setCreateBy(Long value) {
        this.createBy = value;
    }
    
     
    @org.springframework.data.annotation.CreatedDate
    @Column(name = "CREATE_TIME")
    public java.util.Date getCreateTime() {
        return this.createTime;
    }
    
    public void setCreateTime(java.util.Date value) {
        this.createTime = value;
    }
    
     
    @org.springframework.data.annotation.LastModifiedBy
    @Column(name = "UPDATE_BY")
    public Long getUpdateBy() {
        return this.updateBy;
    }
    
    public void setUpdateBy(Long value) {
        this.updateBy = value;
    }
    
     
    @org.springframework.data.annotation.LastModifiedDate
    @Column(name = "UPDATE_TIME")
    public java.util.Date getUpdateTime() {
        return this.updateTime;
    }
    
    public void setUpdateTime(java.util.Date value) {
        this.updateTime = value;
    }
    
     
    @Column(name = "DELETE_FLAG", length = 2)
    public String getDeleteFlag() {
        return this.deleteFlag;
    }
    
    public void setDeleteFlag(String value) {
        this.deleteFlag = value;
    }
    
     
    @Column(name = "ORG_CODE", length = 100)
    public String getOrgCode() {
        return this.orgCode;
    }
    
    public void setOrgCode(String value) {
        this.orgCode = value;
    }
    
     
    @Column(name = "TENENT_ID")
    public Long getTenentId() {
        return this.tenentId;
    }
    
    public void setTenentId(Long value) {
        this.tenentId = value;
    }
    

    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("id",getId())
            .append("code",getCode())
            .append("name",getName())
            .append("output",getOutput())
            .append("outputUnit",getOutputUnit())
            .append("manufaturingTech",getManufaturingTech())
            .append("remark",getRemark())
            .append("attachmentId",getAttachmentId())
            .append("createBy",getCreateBy())
            .append("createTime",getCreateTime())
            .append("updateBy",getUpdateBy())
            .append("updateTime",getUpdateTime())
            .append("deleteFlag",getDeleteFlag())
            .append("orgCode",getOrgCode())
            .append("tenentId",getTenentId())
            .toString();
    }
    
    public int hashCode() {
        return new HashCodeBuilder()
            .append(getId())
            .toHashCode();
    }
    
    public boolean equals(Object obj) {
        if(obj instanceof BpMainProduct == false) return false;
        if(this == obj) return true;
        BpMainProduct other = (BpMainProduct)obj;
        return new EqualsBuilder()
            .append(getId(),other.getId())
            .isEquals();
    }
}

